const errorHtml = `
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta
      name="viewport"
      content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
    />
    <title>错误页面</title>
    <style>
		body {
			text-align: center;
			height: 100vh;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		#app {
			margin: 0 auto;
		}
		#app button {
			width: 100%;
			margin-top: 15px;
			background: #1989fa;
			border: none;
			padding: 0;
			color: #fff;
			border-radius: 4px;
			height: 32px;
		}
    </style>
  </head>
  <body>
    <div id="app">
      <div>啊哦～，您遇到了错误</div>
      <div>别着急，一会儿再进来看看吧</div>
      <div>
        <button onclick="back()">返回</button>
      </div>
    </div>

    <script type="text/javascript">
      window.xwbridge = {
        _onMsg: function (msg) {
          const action = msg.a;
          const data = msg.d;
          if (action === "event") {
            if (data.me === "loadURL") {
				const wv = plus.webview.currentWebview();
				wv.clear();
				wv.loadURL(data.location.href);
            }
          }
        },
		_postMsg(msg) {
			const p = JSON.stringify(msg);
			window.open('k://xe?p='+encodeURIComponent(p));
		}
      };

      function reload() {
		const param = {
			a:'wvapi',
			d:{
				me:'reload',
				force:true
			}
		}
		window.xwbridge._postMsg(param);
      }

      function back() {
        const param = {
        	a:'wvapi',
        	d:{
        		me:'hide'
        	}
        }
        window.xwbridge._postMsg(param);
      }
    </script>
  </body>
</html>
`

export default errorHtml;